package gui;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.print.PrintException;
import lx300.EmissorLX300;
import lx300.MatrixMain;
import modelo.ctrc;


public class GUIPrincipal extends javax.swing.JFrame {

    
    public GUIPrincipal() {
        initComponents();
        //setLocationRelativeTo(null);
    }

    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnAtalhos = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        btCadMotorista = new javax.swing.JButton();
        btCadClientes = new javax.swing.JButton();
        btCtrcMatricial = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        btSair = new javax.swing.JButton();
        pnLogo = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        mnArquivo = new javax.swing.JMenu();
        mnCadastros = new javax.swing.JMenu();
        mnMotoristas = new javax.swing.JMenuItem();
        mnClientes = new javax.swing.JMenuItem();
        mnCtrc = new javax.swing.JMenu();
        mnCtrcMatricial = new javax.swing.JMenuItem();
        mnCte = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Transportes Frederico");
        setExtendedState(GUIPrincipal.MAXIMIZED_BOTH);

        pnAtalhos.setBackground(new java.awt.Color(255, 255, 255));
        pnAtalhos.setLayout(new java.awt.BorderLayout());

        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));

        btCadMotorista.setForeground(new java.awt.Color(255, 255, 255));
        btCadMotorista.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/Male.png"))); // NOI18N
        btCadMotorista.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCadMotoristaActionPerformed(evt);
            }
        });
        jPanel1.add(btCadMotorista);

        btCadClientes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/User group.png"))); // NOI18N
        btCadClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCadClientesActionPerformed(evt);
            }
        });
        jPanel1.add(btCadClientes);

        btCtrcMatricial.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/List.png"))); // NOI18N
        btCtrcMatricial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCtrcMatricialActionPerformed(evt);
            }
        });
        jPanel1.add(btCtrcMatricial);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logos/CT-e nacional24SemFundo.png"))); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton1);

        pnAtalhos.add(jPanel1, java.awt.BorderLayout.WEST);

        jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.LINE_AXIS));

        btSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/Exit.png"))); // NOI18N
        btSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSairActionPerformed(evt);
            }
        });
        jPanel2.add(btSair);

        pnAtalhos.add(jPanel2, java.awt.BorderLayout.EAST);

        getContentPane().add(pnAtalhos, java.awt.BorderLayout.NORTH);

        pnLogo.setLayout(new javax.swing.BoxLayout(pnLogo, javax.swing.BoxLayout.LINE_AXIS));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logos/novo-volvo-fh16-750-2.jpg"))); // NOI18N
        pnLogo.add(jLabel1);

        getContentPane().add(pnLogo, java.awt.BorderLayout.CENTER);

        mnArquivo.setText("Arquivo");
        jMenuBar1.add(mnArquivo);

        mnCadastros.setText("Cadastros");

        mnMotoristas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK));
        mnMotoristas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/Male.png"))); // NOI18N
        mnMotoristas.setMnemonic('M');
        mnMotoristas.setText("Motoristas");
        mnMotoristas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnMotoristasActionPerformed(evt);
            }
        });
        mnCadastros.add(mnMotoristas);

        mnClientes.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        mnClientes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/User group.png"))); // NOI18N
        mnClientes.setMnemonic('C');
        mnClientes.setText("Clientes");
        mnCadastros.add(mnClientes);

        jMenuBar1.add(mnCadastros);

        mnCtrc.setText("Emissão");

        mnCtrcMatricial.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icones24x24/List.png"))); // NOI18N
        mnCtrcMatricial.setText("Ctrc Matricial");
        mnCtrcMatricial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnCtrcMatricialActionPerformed(evt);
            }
        });
        mnCtrc.add(mnCtrcMatricial);

        mnCte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logos/CT-e nacional24SemFundo.png"))); // NOI18N
        mnCte.setText("CT-e");
        mnCte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnCteActionPerformed(evt);
            }
        });
        mnCtrc.add(mnCte);

        jMenuBar1.add(mnCtrc);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mnMotoristasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnMotoristasActionPerformed
        GUIGridMotorista dlgCadMotorista = new GUIGridMotorista(this, true);
        dlgCadMotorista.setVisible(true);
    }//GEN-LAST:event_mnMotoristasActionPerformed

    private void mnCtrcMatricialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnCtrcMatricialActionPerformed
        GUICtrcMatricial frm = new GUICtrcMatricial();
        frm.setVisible(true);
    }//GEN-LAST:event_mnCtrcMatricialActionPerformed

    private void btCadMotoristaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCadMotoristaActionPerformed
        mnMotoristasActionPerformed(evt);
    }//GEN-LAST:event_btCadMotoristaActionPerformed

    private void btCadClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCadClientesActionPerformed
        GUIGridCliente dlgCadCliente = new GUIGridCliente(this, true);
        dlgCadCliente.setVisible(true);
    }//GEN-LAST:event_btCadClientesActionPerformed

    private void btCtrcMatricialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCtrcMatricialActionPerformed
        mnCtrcMatricialActionPerformed(evt);
    }//GEN-LAST:event_btCtrcMatricialActionPerformed

    private void btSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSairActionPerformed
        System.exit(0);
    }//GEN-LAST:event_btSairActionPerformed

    private void mnCteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnCteActionPerformed
        GUICte frm = new GUICte();
        frm.setVisible(true);
    }//GEN-LAST:event_mnCteActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        mnCteActionPerformed(evt);
    }//GEN-LAST:event_jButton1ActionPerformed

   
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btCadClientes;
    private javax.swing.JButton btCadMotorista;
    private javax.swing.JButton btCtrcMatricial;
    private javax.swing.JButton btSair;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JMenu mnArquivo;
    private javax.swing.JMenu mnCadastros;
    private javax.swing.JMenuItem mnClientes;
    private javax.swing.JMenuItem mnCte;
    private javax.swing.JMenu mnCtrc;
    private javax.swing.JMenuItem mnCtrcMatricial;
    private javax.swing.JMenuItem mnMotoristas;
    private javax.swing.JPanel pnAtalhos;
    private javax.swing.JPanel pnLogo;
    // End of variables declaration//GEN-END:variables
}
